/**
 * @Author: 陈瑞鹏
 * @Date:   2022-11-01 17:31:04
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2023-01-30 17:04:56
 */
import mongoose from 'mongoose';

const Schema = mongoose.Schema;

const RoomSchema: mongoose.Schema = new Schema({
  roomId: { type: Number, display: '房间ID', index: true },
  roleId: { type: Number, display: '房主ID', index: true },
  gameId: { type: Number, display: "游戏id" },
  roomData: { type: Array, display: "当前局数数据" },
  isDisMiss: { type: Boolean, display: "是否解散", default: false },
  isGameStart: { type: Boolean, display: "是否已经开始", default: false },
  downTime: { type: Number, display: "倒计时", default: 15 },
  round: { type: Number, display: "第几局", default: 0 },
  updateTime: { type: String, display: '更新时间' },
  createTime: { type: String, display: '创建时间' },
}).index({ roomId: 1 });

const Room = mongoose.model('Room', RoomSchema);
export default Room;